
package com.wobaby.util.xml;

import java.util.Collection;
import java.util.Vector;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class NodeListVector extends Vector
    implements NodeList
{

    public NodeListVector()
    {
    }

    public NodeListVector(Collection c)
    {
        super(c);
    }

    public NodeListVector(int initialCapacity)
    {
        super(initialCapacity);
    }

    public NodeListVector(int initialCapacity, int capacityIncrement)
    {
        super(initialCapacity, capacityIncrement);
    }

    public NodeListVector(NodeList listOfNodes)
    {
        int numNodes = listOfNodes.getLength();
        for(int index = 0; index < numNodes; index++)
            add(listOfNodes.item(index));

    }

    public int getLength()
    {
        return size();
    }

    public Node item(int itemIndex)
    {
        Object retval = get(itemIndex);
        if(!(retval instanceof Node))
            retval = null;
        return (Node)retval;
    }
}